Migrating Database
If you are an existing CCC user planning to upgrade to the latest version and want to migrate your existing database, consider choosing one of the following scenarios:
Migrate your PostgreSQL database
-
Migrate from external PostgreSQL database to internal PostgreSQL database
-
Migrate from internal PostgreSQL database to external PostgreSQL database
Migrate your existing PostgreSQL database as it is
To migrate your existing PostgreSQL database in its current state from the previous CCC version to the latest release, you must first create a backup of your existing database and then restore it into the new CCC deployment. The procedure is described in the Backup and Restore section, which includes instructions for both internal and external database deployments.
Please exercise caution when performing these operations, as database handling requires careful attention to prevent data loss or service interruption. Ensure that a verified backup is available before making any changes, and consult the relevant documentation or support resources for guidance specific to your setup.
Migrate from extrernal PostgreSQL database to internal PostgreSQL database
The steps involved in migrating your external PostgreSQL database to internal PostgreSQL database are:
Install CCC using Podman, as explained here.
Login to the virtual machine that contains your existing PostgreSQL database.
Create a dump of your existing database using the following command:
pg_dump -h IP of source PostgreSQL database -p 5432 -U lunadirector lunadirectordb > postgres.sql
Copy the dump that you’ve created to the podman directory inside the CCC package.
Go the the podman directory inside the CCC package and run the following command to copy the postgres.sql file inside the CCC container:
podman cp postgres.sql ccc:/usr/safenet/ccc/
Run the following command to start data migration to internal PostgreSQL database.
podman exec ccc bash -c 'db-migration --truststore CCC_truststore_password --keystorepass CCC_keystore_password --cccpass CCC_admin_password --dbpass database_password --file filename --copass crypto_officer_password'
If you are using special characters such as # and $ in the password, you need to put a backward slash \ before those characters to avoid errors.
Upon successful completion of the data migration process, you’ll see a confirmation message on your screen. Thereafter, you can login to CCC and check whether the data has been successfully migrated.
Migrate from internal to external PostgreSQL database
Before proceeding, ensure that the external database intended for use is freshly installed and devoid of any existing data. Additionally, configure the database according to the specific requirements outlined for CCC. This ensures optimal performance and a smooth integration with the CCC system.
The steps involved in migrating your internal PostgreSQL database to external PostgreSQL database are:
Utilize the link provided via email to download and extract the CCC package.
Log in to the virtual machine containing CCC with the internal database.
Generate a dump of the existing database by running the following command:
podman exec ccc bash -c "pg_dump 'host=localhost port=5432 dbname=lunadirectordb user=lunadirector password=dbpassword' > postgres.sql"
Transfer the postgres.sql file from the container to the host machine for future reference.
podman cp ccc:/usr/safenet/ccc/postgres.sql .
Initiate the target PostgreSQL database where you intend to migrate the existing database.
Copy the postgres.sql file from the previous step to the target database virtual machine and execute the following command:
psql -h IP of target postgres db -p 5432 -U lunadirector -f postgres.sql lunadirectordb
Install CCC using either Podman or Kubernetes, as explained here.
During CCC installation, while modifying the configuration settings in the Master node, you need to provide various database related details, such as IP of the target database and database password.
Upon successful completion of the CCC installation process, you’ll see a confirmation message on your screen. Thereafter, you can login to CCC and check whether the data has been successfully migrated.
Migrate your Oracle database
To move from CCC 3.9 with Oracle to CCC 4.4 with PostgreSQL, complete a two-phase migration and upgrade sequence. This approach ensures continuity and data integrity across both platform and version transitions:
Upgrade your CCC 3.9 Oracle database to CCC 4.0, which converts it to PostgreSQL. Follow the three-step process detailed in the CCC 4.0 Database Migration Guide.
Once the migration to CCC 4.0 is complete, upgrade the PostgreSQL database to CCC 4.4 using the CCC 4.4 Database Migration Guide.